<?php
/*Problem Domain
Tocreate a class that represents a User Entity in the Training Management System (TMS)
*/

/*
- User is new User(int, int, String, String, String)
- interp. new User(user_id, emp_id, email_id, password, role) represents the User in TMS where
	- user_id is the unique user ID of the system.
	- emp_id is the unique employee ID of Spring CT.
	- email_id is the email ID of the User to login to the system.
	- password is the password of the User to login to the system.
	- role is the role of the User at Spring CT.

- Example.
$usr1 = new User("mohsin.sayyed@springcomputing.in", "******", "trainee"); 
$usr2 = new User("pqr.xyz@springcomputing.in", "******", "admin");
$usr3 = new User("abhijeet.majgaonkar@springcomputing.in", "******", "trainee");

- Template.
function fn-for-User()
{
	...$this->user_id;	//int
	...$this->emp_id;	//int
	...$this->email_id;	//String
        ...$this->password;	//String
	...$this->role;		//String
}
*/

class User
{
	private $user_id;
	private $emp_id;
	private $email_id;
	private $password;
	private $role;

	private $list_sessions;

	/*String, String, String
	purpose. initializes the newly created User*/
	public function __construct($email_id, $password, $role, $user_id = null, $emp_id=null)
	{
		$this->email_id = $email_id;
		$this->password = $password;
		$this->role 	= $role;
		$this->user_id  = $user_id;
		$this->emp_id   = $emp_id;
	}

	/*void -> int
	purpose. produces the user ID of the current User*/
	public function getId()
	{
		return $this->user_id;
	} 

	/*int -> void
        purpose. sets the given user ID for the current User*/
        public function setId($user_id)
        {
                $this->user_id = $user_id;
        }

	/*void -> int
        purpose. produces the emp ID of the current User*/
        public function getEmpId()
        {
                return $this->emp_id;
        }

	/*int -> void
        purpose. sets the given emp ID for the current User*/
        public function setEmpId($emp_id)
        {
                $this->emp_id = $emp_id;
        }

	/*void -> String
        purpose. produces the email ID of the current User*/
        public function getEmailId()
        {
                return $this->email_id;
        }

	/*String -> void
        purpose. sets the given email ID for the current User*/
        public function setEmailId($email_id)
        {
                $this->email_id = $email_id;
        }

	/*void -> int
        purpose. produces the password of the current User*/
        public function getPassword()
        {
                return $this->password;
        }

	/*String -> voiod
        purpose. sets  the give password for  the current User*/
        public function setPassword($password)
        {
                $this->password = $password;
        }

	/*void -> int
        purpose. produces the role of the current User*/
        public function getRole()
        {
                return $this->role;
        }

	/*void -> int
        purpose. sets the given role the current User*/
        public function setRole($role)
        {
                $this->role = $role;
        }

}
?>
